package com.itheima.thread.api.demo02;

public class ThreadDemo01 {

    public static void main(String[] args) {

        // 创建第一步所定义类的对象
        MyRunnable myRunnable = new MyRunnable() ;

        // 创建Thread类的对象，把第三步的对象作为Thread的构造方法参数传递过来 ： public Thread​(Runnable target)
        // public Thread​(Runnable target, String name)
        Thread t1 = new Thread(myRunnable , "貂蝉");
        Thread t2 = new Thread(myRunnable , "吕布") ;

        // 调用setName方法设置线程名称
        // t1.setName("貂蝉");
        // t2.setName("赵云");

        // 启动线程
        t1.start();
        t2.start();

    }

}
